package com.itheima.a13waitandnotify;

public class Num extends Thread{

    @Override
    public void run() {
        int i = 0;
        synchronized (Num.class) {
            while (true) {
                i++;
                System.out.println(getName() + "@" + i);
                Num.class.notifyAll();
                if(i == 100){
                    break;
                }
                try {
                    Num.class.wait();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }
    }
}
